package com.xpec.c4.game.character;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.xpec.c4.service.annotations.Name;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.ScopeType;
import com.xpec.c4.service.group.ServerGroup;
import com.xpec.c4.service.server.CloseType;


/**
 * 角色的消息发送类
 * 
 * @author lipeilin
 * 
 */
@Name(scopeType = ScopeType.SESSION)
public class CharacterSender extends BaseMessageAction{

	private static final Log log = LogFactory.getLog(CharacterSender.class);

	/**
	 * 玩家离开
	 */
	public void playerLogOut(CloseType closeType) {

		//TODO 由於之後的playerManager 主要被拿掉, 再也沒有instance player可以拿,<br>
		// 這邊根本無法找到player, player zone id shremap 應該也要改方式使用
		//可能由login module負責所以離線通知
		List<String> moduleList = ServerGroup.getTransportManager().getLocalModuleList();
		// 根本沒有地方收消息，所以也不需要送了
		/*
		if(moduleList.contains(ModuleName.LOGIN)){
			log.info("playerLogOut, send groupmessage, playerID:" + playerID);
			// 送消息到Zone, 由Zone来处理Player logout
			GroupMessage msg = new GroupMessage();
			msg.setMessageType(MessageTypes.S_PLAYER_LOGOUT_ZONE_MAIN);
			SPlayerLogoutZone info = new SPlayerLogoutZone();
			info.setPlayerGuid(playerID);
			info.setAccountId(accountID);
			info.setCloseType(closeType);
			msg.setDestModuleID(ModuleName.LOGIN);
			msg.setMessageContent(info);
			MessageAction.sendGroupMessage(msg);
		}
		*/
		return;
	}
	
}
